home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-03-22 | 20.3 KB | 659 lines | [TEXT/MPS ] |
- !================================================================
- ! AppleOrder Express Modem.CCL
- !================================================================
- !
- ! USA modem CCL script for the Apple Express Modem
- !
- ! Change History-
- ! v1.0 09/21/90 gs:General Release Version
- ! v1.0.2 12/07/90 gs:Added bug fix for Printer Port ~MPRT selection
- ! v1.0.2 01/30/91 gs:Changed \N3 to \N2 reliable only connection
- ! v2.0d1 12/3/91 gs:Supports ModemCmd and ConnectStr parameters
- ! v2.0 9/7/92 gs:General Release Version
- ! 10/21/92 gs:Changed Label 80 code so that it tries at least 4 times to
- ! sync up in Requesting Network attention before resetting modem.
- ! v2.0.1 3/5/93 gs:Changed "CARRIER" to "NO CARRIER", cleaned up CCL
- ! and other miscellaneous changes
- ! v2.0.2 3/22/93 gs:Use Serial Tool because Express Modem tool not working
- !
- ! The following label ranges (0-255) are defined for all scripts:
- !
- ! Label Function
- ! ----- --------
- ! 0-19 Communications Setup
- ! 20-39 Get a Modem
- ! 40-59 Modem Setup
- ! 60-79 Dialing
- ! 80-99 Physical Connection
- ! 100-119 GEIS Logon
- ! 120-139 CICS
- ! 140-159 APPM
- ! 160-179 Online
- ! 180-199 Terminate Session
- ! 200-209 Cancel
- ! 210-219 Hangup
- ! 230-239 <UNUSED>
- ! 240-255 Disconnect
- !
- ! Note: Label 210 is the modem hangup sequence
- ! Label 240 is reserved as the start of the disconnect sequence
- !
- !================================================================================
- -LABEL 0 !***<Physical connection entry point>*** Initialize Communications
- !================================================================================
- !
- ! Make sure the CTB is closed first
- ! CTBCLOSE [<LabelIfOpenFails>] [<LabelIfError>]
- CTBClose 12 13
- !
- ! CTBTOOL <Toolname> [<LabelIfToolDoesn'tExist>] [<LabelIfError>] [<ctb flags>] [<buffer sizes>]
- !CTBTool "Express Modem Tool" 4 5
- !
- ! CTBPARAMETER <ParameterName> <NewValue> [<LabelIfError>]
- !CTBParameter ModemMode DataUser 6
- !CTBParameter Protocol V42_MNP 6
- !CTBParameter TypeOfCall DirectATCommands 6
- !CTBParameter Parity None 6
- !CTBParameter DataBits 8 6
- !CTBParameter StopBits 1 6
- !CTBParameter Handshake XON/XOFF 6
-
- ! until the problem using the Express Modem Tool is fixed, must use SerialTool
- CTBParameter Port "Internal Modem" 6
- CTBParameter Baud ~Baud 6
- !
- DsplyMsg Opening the connection...
- !
- ! CTBOPEN [<LabelIfOpenFails>] [<LabelIfError>]
- CTBOpen 14 15 ! Open the Communications session
- !
- ! Flush any data, Initialize script variables and define Cancel label
- Flush ! clear input buffer and ring buffer
- CanBtn 200 ! If user cancels, take the error return
- !
- SetVar 1 0 ! #of consecutive no responses to hangup command
- SetVar 2 0 ! #of consecutive no responses to modem configuration command
- SetVar 3 0 ! #of consecutive network contact failures.
- SetVar 4 0 ! #of logon validation failures
- SetVar 5 0 ! #of consecutive CICS90 failures
- SetVar 6 0 ! #of consecutive APPM failures
- SetVar 7 0 ! flag to indicate if connecting(0) or disconnecting(1)
- SetVar 8 0 ! not used
- !
- Jump 40 ! Go to Modem Selection and Setup
- !
- !*********
- -LABEL 4 !---<Express Modem Tool missing>---
- !*********
- Alert -1 The Express Modem tool cannot be found in your System folder.\13Please install it, and try again.
- Exit -1 ! exit the script with an error
- !
- !*********
- -LABEL 5 !---<CTBTool Comm Toolbox err>---
- !*********
- Alert -1 A CTBTool error has occurred in the Communications Toolbox.\13Please try again.\13If the problem continues, call the Apple USA helpline.
- Exit -1 ! exit the script with an error.
- !
- !*********
- -LABEL 6 !---<CTBParameter failed>---
- !*********
- Alert -1 Express Modem CTBParameter message caused an error.
- Exit -1 ! exit the script with an error.
- !
- !*********
- -LABEL 12 !---<CTBClose failed>---
- !*********
- Alert -1 CTBClose could not close communications.\13The serial port may already be in use.
- Exit -1 ! exit the script with an error.
- !
- !**********
- -LABEL 13 !---<CTBClose err>---
- !**********
- Alert -1 CTBClose caused a Communications Toolbox error.
- Exit -1 ! exit the script with an error.
- !
- !*********
- -LABEL 14 !---<CTBOpen failed>---
- !*********
- Alert -1 CTBOpen could not open communications.\13The serial port may already be in use.
- Exit -1 ! exit the script with an error.
- !
- !**********
- -LABEL 15 !---<CTBOpen err>---
- !**********
- Alert -1 CTBOpen caused a Communications Toolbox error.
- Exit -1 ! exit the script with an error.
- !
- !================================================================================
- -LABEL 40 !***<Modem Setup>*** Modem Reset and Setup
- !================================================================================
- DsplyPic 1
- DsplyMsg Making sure the modem is ready...
- Jsr 210 ! Hang up (just in case)
- SetVar 1 0 ! clear # hangup tries counter
- !
- DsplyMsg Resetting the Express Modem…
- MatchStr 1 42 OK
- Xmit AT&F\13
- Wait 300
- !
- !**********
- -LABEL 42 ! ---<Got modem attention>---
- !**********
- DsplyMsg Setting modem parameters...
- MatchStr 1 60 OK
- ! should xmit ATE0S36=4&Q5 for Express Modem
- Xmit ~HCMD\13
- Wait 300 ! wait up to 5 secs for a response
- IncVar 2 ! increment # modem setup tries
- IfVar 2 3 44 ! if 3 tries, display Modem Configuration Alert
- DsplyMsg Modem not responding to setup commands. Retrying...
- Pause 90
- Jump 42 ! else try modem setup again
- !
- !**********
- -LABEL 44 ! ---<Modem configuration err>---
- !**********
- Bell
- Alert 200 The modem is not responding to setup commands.\13Turn the modem off and then on again before retrying.
- SetVar 2 0 ! clear # modem setup tries
- Jump 40 ! reset modem and try again
- !
- !================================================================================
- -LABEL 60 !***<Modem ready>*** Dial phone
- !================================================================================
- DsplyMsg Dialing ~Fone...
- DsplyPic 2
- ! Look for one of the following expected responses
- MatchStr 1 80 ~GSTR
- MatchStr 2 80 PROTOCOL:LAP-M
- MatchStr 3 80 PROTOCOL:ALT
- MatchStr 4 62 ERROR
- MatchStr 5 66 NO CARRIER
- MatchStr 6 70 BUSY
- MatchStr 7 74 NO DIAL
- SetVar 2 0 ! clear #modem setup tries
- Flush
- Xmit ATD~Tone~Fone\13
- Wait 2400 ! wait up to 40 secs for a response
- !
- !**********
- -LABEL 62 !---<No response or ERROR from modem>---
- !**********
- IncVar 3 ! Increment # dial attempts counter
- IfVar 3 4 64 ! if 4 attempts, display No Dial Response Alert
- DsplyMsg Modem does not respond to Dial command. Retrying...
- Pause 90
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 64 !---<No dial response err>---
- !**********
- Bell
- Alert 200 The modem is not responding to dial command.\13Make sure your modem is connected to a phone line.
- SetVar 3 0 ! clear # dial attempts counter
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 66 !---<No Carrier>---
- !**********
- IncVar 3 ! Increment # dial attempts counter
- IfVar 3 4 68 ! if 4 attempts, display No Carrier Alert
- DsplyMsg No Carrier with phone number dialed. Retrying...
- Pause 90
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 68 !---<No carrier err>---
- !**********
- Bell
- Alert 200 Cannot detect carrier signal after dialing.\13Make sure the phone number provided is correct.
- SetVar 3 0 ! clear # dial attempts counter
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 70 !---<busy>---
- !**********
- IncVar 3 ! Increment # dial attempts counter
- IfVar 3 4 72 ! if 4 attempts, display Busy Alert
- DsplyMsg Phone number dialed is busy. Pausing before retrying...
- Wait 300 ! wait 5 secs
- DsplyMsg Retrying...
- Pause 90
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 72 !---<Busy err>---
- !**********
- Bell
- Alert 200 All network access lines are in use.\13Try again later.
- SetVar 3 0 ! clear # dial attempts counter
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 74 !---<No Dialtone>---
- !**********
- IncVar 3 ! Increment # dial attempts counter
- IfVar 3 4 76 ! if 4 attempts, display No Dialtone Alert
- DsplyMsg Modem reports no dial tone. Retrying...
- Pause 90
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 76 !---<No dialtone Error>---
- !**********
- Bell
- Alert 200 Modem reports no dial tone.\13Make sure your modem is connected to a phone line.
- SetVar 3 0 ! clear # dial attempts counter
- Jump 40 ! reset modem and try again
- !
- !================================================================================
- -LABEL 80 !***<Establish Physical Connection>*** Send H's to identify us to network
- !================================================================================
- DsplyMsg Requesting network attention...
- ! Look for one of the following expected responses
- MatchStr 1 84 NO CARRIER
- MatchStr 2 100 U#
- Xmit HH
- Wait 600 ! Allow 10 seconds for the U# to show up
- IncVar 3 ! No U#, increment # dial attempts counter
- IfVar 3 4 82 ! if 4 attempts, display No U# Alert
- Jump 80 ! else try again
- !
- !**********
- -LABEL 82 !---<No U#>---
- !**********
- Bell
- Alert 200 Unable to get the network's attention.\13Make sure you have the correct phone number.
- SetVar 3 0 ! clear # dial attempts counter
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 84 !---<Line dropped>---
- !**********
- IncVar 3 ! Increment # dial attempts counter
- IfVar 3 4 86 ! if 4 attempts, display Line Dropped Alert
- DsplyMsg Carrier signal dropped before network recognition. Retrying...
- Pause 90
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 86 !---<Line dropped Err>---
- !**********
- Bell
- Alert 200 Carrier signal dropped before network recognition.\13Try again.
- SetVar 3 0 ! clear # dial attempts counter
- Jump 40 ! reset modem and try again
- !
- !================================================================================
- -LABEL 100 !***<GEIS logon>***
- !================================================================================
- !
- DsplyMsg Physical Connection established. Logging on to network...
- DsplyPic 3
- SetVar 3 0 ! clear # dial attempts counter
- Wait 6 ! wait 0.1 sec
- Flush ! clear input buffer
- ! Note: leave 2 spaces between ~Dist and ~Numb
- Xmit ~User,~Dist ~Numb,~Ridn\13
- !
- ! Look for one of the following expected responses
- MatchStr 1 104 NO CARRIER
- MatchStr 2 106 DISCONNECTED
- MatchStr 3 120 ===>
- MatchStr 6 108 N FAULT,
- MatchStr 7 108 T FORMAT,
- MatchStr 8 110 L DENIED
- MatchStr 9 112 BUSY
- MatchStr 10 112 DOWN
- Wait 600 ! wait up to 10 seconds for a response
- IncVar 4 ! Increment # logon attempts counter
- IfVar 4 3 102 ! if 3 tries, display No Login Response alert
- DsplyMsg No logon response from network. Retrying...
- Pause 90
- Jump 100 ! try again
- !
- !*********
- -LABEL 102 !---<No Logon response>---
- !*********
- Bell
- Alert 200 No logon response from network.\13Try again.
- SetVar 4 0 ! clear # logon attempts counter
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 104 !---<Carrier dropped>---
- !*********
- IncVar 4 ! Increment # login attempts counter
- IfVar 4 3 105 ! if 3 attempts, display Carrier dropped alert
- DsplyMsg Carrier signal dropped during network logon. Retrying...
- Pause 90
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 105 !---<Carrier dropped Err>---
- !*********
- Bell
- Alert 200 Carrier signal dropped during network logon.\13Try again.
- SetVar 4 0 ! clear # logon attempts counter
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 106 !---<Session disconnected>---
- !*********
- IncVar 4 ! Increment # logon attempts counter
- IfVar 4 3 107 ! if 3 attempts, display Session disconnected alert
- DsplyMsg Network connection dropped during network logon. Retrying...
- Pause 90
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 107 !---<Session disconnected Err>---
- !*********
- Bell
- Alert 200 Network connection dropped during network logon.\13Try again.
- SetVar 4 0 ! clear # logon attempts counter
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 108 !---<Validation fault>---
- !*********
- IncVar 4 ! Increment # logon attempts counter
- IfVar 4 3 109 ! see if limit of 3 is exceeded.
- DsplyMsg Network rejected your identification. Retrying...
- Pause 90
- Jump 100 ! retry GEIS login (only case where we don't reset)
- !
- !*********
- -LABEL 109 !---<validation fault err>---
- !*********
- Bell
- Alert 200 Your network identification has been rejected.\13Check Setup to make sure your identification is correct.
- SetVar 4 0 ! clear # logon attempts counter
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 110 !---<Denied by host>---
- !*********
- IncVar 4 ! Increment # logon attempts counter
- IfVar 4 3 111 ! if 3 attempts, display Network Problem alert
- DsplyMsg Network host equipment problem detected. Retrying...
- Pause 90
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 111 !---<Denied by host err>---
- !*********
- Bell
- Alert 200 Network host equipment problem detected.\13Try again.
- SetVar 4 0 ! clear # logon attempts counter
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 112 !---<MARK3K access busy/down>---
- !*********
- IncVar 4 ! Increment # logon attempts counter
- IfVar 4 3 113 ! if 3 attempts, display Network Busy alert
- DsplyMsg Network equipment busy/down. Retrying...
- Pause 90
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 113 !---<MARK3K access busy/down err>---
- !*********
- Bell
- Alert 200 Network equipment busy or down.\13Try again.
- SetVar 4 0 ! clear # logon attempts counter
- Jump 40 ! reset modem and try again
- !
- !================================================================================
- -LABEL 120 !***<MARK3000 prompt>*** Invoke CICS
- !================================================================================
- !
- DsplyMsg Requesting access to network subsystem...
- DsplyPic 4
- Wait 6 ! wait 0.1 secs
- Flush ! clear input buffer
- !
- Xmit ~CICS\13
- ! Look for one of the following expected responses
- MatchStr 3 140 READY
- ! To overcome a network problem, the following label was changed from 124 to 126
- ! MatchStr 4 124 T BOUND
- MatchStr 4 126 T BOUND
- MatchStr 5 126 UNRECOGN
- MatchStr 6 126 ===>
- Wait 3600 ! Allow 60 secs for the expected responses to show up
- IncVar 5 ! Timeout, so increment # CICS tries counter
- IfVar 5 2 122 ! if 3 tries, display No Response alert
- DsplyMsg No response to network subsystem request. Retrying...
- Pause 90
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 122 !---<No CICS err>---
- !*********
- Bell
- Alert 200 No response to network subsystem request.\13Try again.
- SetVar 5 0 ! clear # CICS tries counter
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 124 !---<Session not bound err>---
- !*********
- Bell
- Alert 200 Network CICS subsystem needs to be started.\13Please contact the Apple USA helpline immediately.
- Jump 200 ! jump to cancel routine
- !
- !*********
- -LABEL 126 !---<Invalid application>---
- !*********
- IncVar 5 ! Increment # CICS tries counter
- IfVar 5 3 127 ! if 3 tries, display Invalid Application alert
- DsplyMsg Network subsystem request has been rejected. Retrying...
- Pause 90
- Flush
- Jump 120 ! try to access CICS again
- !
- !*********
- -LABEL 127 !---<Invalid application err>---
- !*********
- Bell
- Alert 200 The network subsystem request has been rejected.\13Try again.
- SetVar 5 0 ! clear # CICS tries counter
- Flush
- Jump 40 ! reset modem and try again
- !
- !================================================================================
- -LABEL 140 !***<CICS ready>*** Start APPM transaction
- !================================================================================
- !
- DsplyMsg Requesting access to distribution center ~Dist...
- DsplyPic 5 ! Highlight box 5 on screen
- SetVar 5 0 ! clear # CICS tries counter
- ! ! Send what needs to be sent
- Xmit ~Epgm~Dist\13
- ! Look for one of the following expected responses
- Wait 12 ! wait 0.2 secs
- Flush ! clear input buffer
- ! Look for one of the following expected responses
- MatchStr 3 160 C100
- MatchStr 4 144 INVALID
- Wait 3600 ! Allow 60 secs for the expected responses to show up
- !
- IncVar 6 ! Timeout, so Increment # APPM tries counter
- IfVar 6 2 142 ! if 2 tries, display No Transaction alert
- DsplyMsg No response to distribution center access request. Retrying...
- Pause 90
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 142 !---<No transaction response>---
- !*********
- Bell
- Alert 200 No response to distribution center access.\13Try again.
- SetVar 6 0 ! reset # APPM tries counter
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 144 !---<Invalid transaction>---
- !*********
- IncVar 6 ! Increment # APPM tries counter
- IfVar 6 2 145 ! if 2 tries, display Invalid Transaction alert
- DsplyMsg Distribution center access request rejected. Retrying...
- Pause 90
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 145 !---<Invalid transaction err>---
- !*********
- Bell
- Alert 200 Distribution center access request rejected.\13Check Setup to make sure your identification is correct.
- SetVar 6 0 ! reset # APPM tries counter
- Jump 40 ! reset modem and try again
- !
- !================================================================================
- -LABEL 160 !***<Online>***
- !================================================================================
- !
- Wait 60 ! wait 1 sec
- DsplyMsg Accessing the distribution center ~Dist...
- DsplyPic 6 ! Highlight box 6 on screen
- ! C9 = pass msg thru GE, 899 = Echo cmd
- Xmit C9899Ole\13
- ! Look for one of the following expected responses
- MatchStr 2 162 C5
- MatchStr 3 170 Ole\13
- Wait 7200 ! wait 2 minutes for echo back or distribution center nonavail msg
- !
- !*********
- -LABEL 162 !---<no luck this time>---
- !*********
- DsplyMsg Distribution center is not available...
- Pause 90
- Jsr 180 ! terminate session
- Bell
- Alert -1 Distribution center is not available.\13Please try again later.
- Jump 200 ! exit to Cancel routine
- !
- !*********
- -LABEL 170 !---<Success, we’re in, so exit>---
- !*********
- Wait 30 ! wait 0.5 secs
- Flush ! clear input buffer
- Exit 0 ! exit the script normally
- !
- !================================================================================
- -LABEL 180-199 !***<Terminate Session>***
- !================================================================================
- !
- !*********
- -LABEL 180 !---<Terminate session>---
- !*********
- ! send Abnormal disconnect command
- Xmit C3\13
- ! Look for one of the following expected responses
- MatchStr 1 182 U#
- Wait 300 ! wait 5 secs
- Return
- !
- !*********
- -LABEL 182 !---<Say bye>---
- !*********
- Wait 6 ! wait 0.1 sec and sign off the network
- Xmit BYE\13
- Return
- !
- !================================================================================
- -LABEL 200 !***<Cancel Routine>***
- !================================================================================
- DsplyMsg Cancelling...
- Flush
- Wait 30 ! wait 0.5 secs
- Exit -1 ! exit the script with an error
- !
- !================================================================================
- -LABEL 210 !***<Hang up phone Routine>***
- !================================================================================
- SetVar 1 0 ! clear # hangup tries counter
- SetVar 2 0 ! clear # modem config tries counter
- MatchStr 1 212 OK
- MatchStr 2 212 NO CARRIER
- ChrDelay 0
- !
- !*********
- -LABEL 211
- !*********
- Pause 80
- Xmit +++
- Pause 80
- Flush
- Xmit AT\13
- Wait 300
- IncVar 1
- IfVar 1 2 213
- Jump 211
- !
- !*********
- -LABEL 212
- !*********
- MatchStr 1 214 OK
- Xmit ATH\13
- Wait 300
- !
- !**********
- -LABEL 213 ! ---<Modem Hangup err>---
- !**********
- Bell
- Alert 200 The modem is not responding to the hangup command.\13Turn the modem off and then on again before retrying.
- SetVar 1 0
- SetVar 2 0
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 214
- !*********
- Return
- !
- !================================================================================
- -LABEL 230-239 !***<UNUSED>***
- !================================================================================
- !
- !================================================================================
- -LABEL 240 !***<Disconnection Sequence>***
- !================================================================================
- !
- ! If the connection is closed, we cant hangup, so just exit
- ! CTBIFCLOSED <LabelToGotoIfConnectionClosed>
- CTBIFCLOSED 246
- !
- SetVar 7 1 ! We're disconnecting, so set the flag
- ! Look for one of the following expected responses
- MatchStr 1 242 U#
- MatchStr 2 244 NO CARRIER
- Wait 60 ! wait 1 sec
- Jump 244 ! and hang up the phone
- !
- !*********
- -LABEL 242 !---<Sign off the network>---
- !*********
- Xmit BYE\13
- Wait 120 ! wait 2 secs
- !
- !*********
- -LABEL 244 !---<Hang up the phone>---
- !*********
- SetVar 1 0 ! clear the # hangup tries counter
- Jsr 210 ! Execute the Hang-up subroutine
- ! No CTBClose here because the connection is closed externally from the script
- ! in case we exited the script with an error before completion.
- Flush ! clear input buffer
- Exit 0 ! exit the script normally
- !
- !*********
- -LABEL 246 !---<Connection Was Closed>---
- !*********
- Flush ! clear input buffer
- Exit 0 ! exit the script normally
- ###
-